﻿@model IList<XCode.Membership.Log>
@using NewLife;
@using NewLife.Web;
@using XCode;
@using XCode.Configuration;
@using System.Web.Mvc;
@using System.Web.Mvc.Ajax;
@using System.Web.Mvc.Html;
@using System.Web.Routing;
@{
    var fact = ViewBag.Factory as IEntityOperate;
    var page = ViewBag.Page as Pager;
    var fields = ViewBag.Fields as IList<FieldItem>;
    var enableSelect = this.EnableSelect();

}
<div class="kt-widget4" style="overflow-x:auto;">
    <table class="table table-striped table-bordered table-hover table-checkable table-sm ">
        <thead>
            <tr>
                @if (enableSelect)
                {
                    <th class="text-center" style="width:10px;">
                        <label class="m-checkbox m-checkbox--solid m-checkbox--brand">
                            <input type="checkbox" id="chkAll" title="全选" />
                            <span></span>
                        </label>
                    </th>
                }
                <th class="text-center hidden-md hidden-sm hidden-xs"><a href="@Html.Raw(page.GetSortUrl("ID"))">编号</a></th>
                <th class="text-left"><a href="@Html.Raw(page.GetSortUrl("Category"))">类别</a></th>
                <th class="text-left"><a href="@Html.Raw(page.GetSortUrl("Action"))">操作</a></th>
                <th class="text-left"><a href="@Html.Raw(page.GetSortUrl("Remark"))">详细信息</a></th>
                <th class="text-right"><a href="@Html.Raw(page.GetSortUrl("LinkID"))">链接</a></th>
                <th class="text-left"><a href="@Html.Raw(page.GetSortUrl("UserName"))">用户名</a></th>
                <th class="text-left"><a href="@Html.Raw(page.GetSortUrl("CreateIP"))">IP地址</a></th>
                <th class="text-left"><a href="@Html.Raw(page.GetSortUrl("CreateAddress"))">物理地址</a></th>
                <th class="text-right" style="min-width:134px;"><a href="@Html.Raw(page.GetSortUrl("CreateTime"))">时间</a></th>
                @if (this.Has(PermissionFlags.Detail))
                {
                    <th class="text-center" style="min-width:50px;">操作</th>
                }
            </tr>
        </thead>
        <tbody>
            @foreach (var entity in Model)
            {
                <tr>
                    @if (enableSelect)
                    {
                        <td class="text-center">
                            <label class="m-checkbox m-checkbox--solid m-checkbox--success">
                                <input type="checkbox" name="keys" value="@entity.ID" />
                                <span></span>
                            </label>
                        </td>
                    }
                    <td class="text-center hidden-md hidden-sm hidden-xs">@entity.ID</td>
                    <td>@entity.Category</td>
                    <td>@entity.Action</td>
                    <td style="max-width:600px;overflow:hidden;white-space: nowrap;text-overflow: ellipsis;" title="@entity.Remark">@entity.Remark</td>
                    <td class="text-right">@entity.LinkID.ToString("n0")</td>
                    <td>@entity.UserName</td>
                    <td>@entity.CreateIP</td>
                    <td>@entity.CreateIP.IPToAddress()</td>
                    <td class="text-right" style="max-width:150px">@entity.CreateTime.ToFullString("")</td>
                    @if (this.Has(PermissionFlags.Detail))
                    {
                        <td class="text-center" style="width: 50px;">
                            @*@Html.Partial("_List_Data_Action_Menu", (Object)entity)*@
                            <a href="@Url.Action("Detail",  entity.GetRouteKey())" class="btn btn-outline-hover-primary text-primary btn-sm p-0 pr-2 pl-2 pt-1 editcell" title="查看">
                                <i class="flaticon2-document text-primary"></i>
                            </a>
                        </td>
                    }
                </tr>
            }
        </tbody>
    </table>
</div>